<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>每日一言管理页面</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>

<script type="text/javascript">
	
	var baseUrl = '${pageContext.request.contextPath}/admin/blogger';
	
	function submitData(){
		var dailyWord=$("#dailyWord").val();
		
		if(dailyWord==null || dailyWord==''){
			alert("请输入每日一言！");
		}else{
			$.post(baseUrl+'/updateDailyWord.do',{'dailyWord':dailyWord},function(result){
				if(result.success){
					confirm("每日一言已修改！");
				}else{
					confirm("每日一言修改失败！");
				}
			},"json");
		}
	}
	
	$(function(){
		var url = baseUrl+'/find.do'
		$.getJSON(url,function(data){
			$("#dailyWord").val(data.dailyWord);
		});
	});
	
</script>
</head>
<body style="margin: 10px">
<div id="p" class="easyui-panel" title="修改每日一言" style="padding: 10px">
	 	<table cellspacing="20px" id="dg">
	   		<tr>
	   			<td>每日一言：</td>
	   			<td><textarea id="dailyWord" name="dailyWord" cols="5" style="width: 500px;height: 60px;text-indent: 2em;border-radius: 5px;padding:10px;"></textarea></td>
	   		</tr>
	   		<tr>
	   			<td>
	   				<a href="javascript:submitData()" class="easyui-linkbutton" data-options="iconCls:'icon-submit'">提交</a>
	   			</td>
	   		</tr>
	   	</table>
 </div>
 
</body>
</html>